VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "EntiyManagerClass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Public Entities As New Collection


Public Function AddPlayer(Name As String) As String
Dim Player As New PlayerClass
Player.Name = Name
Entities.Add Player, CStr(Hex(ObjPtr(Player)))
AddPlayer = CStr(Hex(ObjPtr(Player)))
End Function

Public Sub RemovePlayer(Name As String)
Dim Player As PlayerClass
For Each Player In Entities
If TypeOf Player Is PlayerClass Then
If LCase(Player.Name) = LCase(Name) Then RemoveEntity (CStr(Hex(ObjPtr(Player))))
End If
Next
End Sub

Public Sub RemoveEntity(Key As String)
Entities.Remove Key
End Sub

Public Sub EntityDraw(ByVal X As Integer, ByVal Y As Integer)
If EntityMgr.Entities.Count Then
Dim Entity As EntityBaseClass
For Each Entity In EntityMgr.Entities
With Entity
If X = Round(.X) And Y = Round(.Y) Then
Entity.Draw
End If
End With
Next
End If
End Sub

Public Sub UpdateEntities()
If EntityMgr.Entities.Count Then
Dim Entity As EntityBaseClass
For Each Entity In EntityMgr.Entities
With Entity
Entity.Update
End With
Next
End If
End Sub
